Set Port Mode

  • Function:

    magicbox.set_port(port, io_func)
    
  • Description: set mode of port

  • Required parameter:

    • port: EIO address, range: 1~26
    • io_func: port mode, range: 0~6, can be also set as characters
      • 0: magicbox.DUMMY, no function configured
      • 1: magicbox.DO, IO output
      • 2: magicbox.PWM, PWM output
      • 3: magicbox.DI, IO input
      • 4: magicbox.ADC, AD input
      • 5: magicbox.DIPU, pull-up input
      • 6: magicbox.DIPD, pull-down input
  • Return:

    • True: The command has been finished.
    • False: The command has not been finished.
  • Example

    magicbox.set_port(port=1, io_func=magicbox.DO)
    

    Set the mode of EIO1 port as IO output.

results matching ""

    No results matching ""